import request from '@/utils/request'

// 任务统计
export function getStatisticsList(data) {
  return request({
    url: '/api/system/performance/task/getStatisticsList',
    method: 'post',
    data: data
  })
}

// 查询任务
export function listTask(data) {
  return request({
    url: '/api/system/performance/task/getPageList',
    method: 'post',
    data: data
  })
}

// 根据ids查询任务
export function listUser() {
  return request({
    url: '/api/system/test/getUserList',
    method: 'post'
  })
}

// 查询工时系统任务
export function getTimeSystemTaskList(data) {
  return request({
    url: '/api/system/test/getTaskDetailList',
    method: 'post',
    data: data
  })
}


// 工时系统的任务转换存储
export function taskConversionStorage(data) {
  return request({
    url: '/api/system/test/conversionStorage',
    method: 'post',
    data: data
  })
}

// 根据ids查询任务
export function listTaskByIds(taskIds) {
  return request({
    url: '/api/system/performance/task/getListByIds',
    method: 'post',
    data: {"ids": taskIds}
  })
}

// 批量保存
export function batchSaveTask(data) {
  return request({
    url: '/api/system/performance/task/batchSave',
    method: 'post',
    data: data
  })
}

// 任务认可
export function approveTask(data) {
  return request({
    url: '/api/system/performance/task/conditionModify',
    method: 'post',
    data: data
  })
}

// 删除任务
export function delTask(taskIds) {
  return request({
    url: '/api/system/performance/task/batchDeleteByIds/',
    method: 'post',
    data: {"ids": taskIds}
  })
}

// 导出任务
export function exportTask(data) {
  return request({
    url: '/api/system/performance/task/export',
    method: 'post',
    data: data,
    responseType: 'blob', // 告诉axios返回的数据是二进制数据
  })
}

// 迁移导出任务
export function migrationExportTask(taskIds) {
  return request({
    url: '/api/system/performance/task/migrationExport',
    method: 'post',
    data: {"ids": taskIds},
    responseType: 'blob', // 告诉axios返回的数据是二进制数据
  })
}
